import { createRouter, createWebHashHistory } from "vue-router";


const routes = [
    {
        path: '/',
        name: 'login',
        component: () => import('../views/login.vue')
    },
    {
        path:'/test',
        name:'test',
        component: () => import('../test/test.vue')
    },
    {
        path:'/index',
        name:'index',
        component: () => import('../views/index.vue'),
        children:[//二级路由
            {
                path:'adminUser',
                name:'adminUser',
                component:() => import('../components/admin/user.vue')
            },
            {
                path:'adminUserAdd/:identify',
                name:'adminUserAdd',
                component:() => import('../components/admin/userChange.vue')
            },
            {
                path:'adminUserUpdate/:id',
                name:'adminUserUpdate',
                component:() => import('../components/admin/userChange.vue')
            },
            {
                path:'adminAddLab',
                name:"adminAddLab",
                component:() => import('../components/admin/labChange.vue')
            },
            {
                path:'adminLab',
                name:"adminLab",
                component:() => import('../components/admin/lab.vue')
            },
            {
                path:'adminCheckLab/:id',
                name:"adminCheckLab",
                component:() => import('../components/admin/labChange.vue')
            },
            {
                path:'adminOrder',
                name:"adminOrder",
                component:() => import('../components/admin/order.vue')
            },

            {
                path:'user/:id',
                name:'user',
                component:() => import('../components/common/user.vue')
            },
            {
                path:'lab',
                name:"lab",
                component:() => import('../components/common/lab.vue')
            },
            {
                path:'order',
                name:"adminLabAdd",
                component:() => import('../components/common/order.vue')
            },
            {
                path:'labDetail/:id',
                name:"labDetail",
                component:() => import('../components/common/labDetail.vue')
            },
            {
                path:'search',
                name:"adminLabCheck",
                component:() => import('../components/common/search.vue')
            }
        ]
    }
];

export default createRouter({
    history: createWebHashHistory(),
    routes,
});
